package com.classtwo.colleage.conf;

import com.classtwo.colleage.model.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;

import java.util.List;
import java.util.Optional;

/**
 * 连接Teacher表与数据库
 */
public interface DatabaseTeacherInfo extends JpaRepository<Teacher,Integer> {

    // SELECT * from teacher WHERE username='one' AND `password`=136500
    List<Teacher> findByUsernameAndPassword(String Username, String Password);

    // SELECT * from teacher WHERE username='one'
    Teacher  findByUsername(String Username);

    // SELECT * from teacher WHERE username='one'
    Teacher  findFirstByUsername(String Username);


}
